<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">

    <title>${systemTitle}${systemSubtitle}</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
    <meta name="description" content="这是一个 table 页面">
    <meta name="keywords" content="table">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="/assets/css/amazeui.css"/>
    <link rel="stylesheet" href="/assets/css/admin.css">

    <link href="/kindeditor/themes/default/default.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/assets/datetimepicker/css/amazeui.datetimepicker.css">
    <link rel="stylesheet" href="/layer/css/modules/layer/default/layer.css">

    <script src="/kindeditor/kindeditor-all.js"></script>
    <script src="/cjwJs/kindEditor.js"></script>
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
    以获得更好的体验！</p>
<![endif]-->

<header class="am-topbar admin-header">
    <div class="am-topbar-brand">
        <strong>${systemTitle}</strong>
        <small>${systemSubtitle}</small>
        <!--<button id="test2">小小提示层2</button>-->
        <!--<button id="coverSelection" onClick="selectImage()">选择封面图片</button>-->
    </div>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only"
            data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span
            class="am-icon-bars"></span></button>

    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
            <li class="am-dropdown" data-am-dropdown>
                <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
                    <span class="am-icon-users"></span> 管理员 <span class="am-icon-caret-down"></span>
                </a>
                <ul class="am-dropdown-content">
                    <li id="changePassword"><a href="#"><span class="am-icon-user"></span> 修改密码</a></li>
                    <li><a href="/bk/user/logout/"><span class="am-icon-power-off"></span> 退出</a></li>
                </ul>
            </li>
        </ul>
    </div>
</header>

<div class="am-cf admin-main">
    <!-- sidebar start -->
    <div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
        <div class="am-offcanvas-bar admin-offcanvas-bar">
            <ul class="am-list admin-sidebar-list">
                <#list slider as item>
                    <li><a href="${item.link}"><span class="am-icon-sign-out"></span> ${item.title}</a></li>
                </#list>
            </ul>
        </div>
    </div>
    <!-- sidebar end -->

    <!-- content start -->
    <div class="admin-content" id="app">

        <div class="am-cf am-padding">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">${title}</strong> /
                <small>${subtitle}</small>
            </div>
        </div>

        <div class="am-tabs am-margin" data-am-tabs>
            <div class="am-tab-panel am-active" id="tab1">
                <form class="am-form" method="post" enctype="multipart/form-data" action="${action}">
                    <div hidden>
                        <input type="text" class="am-input-sm" value="${(info.id)!''}" name="bkShop.id">
                    </div>

                    <!--<div class="am-g am-margin-top-sm">-->
                    <!--<div class="am-u-sm-4 am-u-md-2 am-text-right">-->
                    <!--封面图片-->
                    <!--</div>-->
                    <!--<div class="am-u-sm-8 am-u-md-4 am-u-end">-->
                    <!--<img id="coverImage" src="${(info.image)!''}" style="max-width: 200px;max-height: 100px;"/>-->
                    <!--<br>-->
                    <!--&lt;!&ndash;<input id="title" type="text" class="am-input-sm" name="pxlmWxNews.title" value="${(info.title)!''}">&ndash;&gt;-->
                    <!--<button id="coverSelection" onClick="return selectImage()">选择封面图片</button>-->
                    <!--</div>-->
                    <!--</div>-->

                    <div class="am-g am-margin-top-sm">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            店名
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end">
                            <input type="text" class="am-input-sm" name="bkShop.name" value="${(info.name)!''}">
                        </div>
                    </div>

                    <div class="am-g am-margin-top-sm">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            地址
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end">
                            <input type="text" class="am-input-sm" name="bkShop.address" value="${(info.address)!''}">
                        </div>
                    </div>

                    <div class="am-g am-margin-top-sm">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            电话
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end">
                            <input type="text" class="am-input-sm" name="bkShop.phone" value="${(info.phone)!''}">
                        </div>
                    </div>

                    <div class="am-g am-margin-top-sm">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            简介
                        </div>
                        <div class="am-u-sm-8 am-u-md-4 am-u-end">
                            <textarea rows="4" name="bkShop.intro"
                                      value="${(info.intro)!''}">${(info.intro)!''}</textarea>
                        </div>
                    </div>

                    <div class="am-g am-margin-top-sm">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            营业时间
                        </div>

                        <div class="am-u-sm-8 am-u-md-4 am-u-end">
                            <div class="am-input-group date am-u-sm-6" id="openTime" data-date-format="dd-mm-yyyy">
                                <label for="startTime">开始时间</label>
                                <input size="16" type="text" id="startTime" name="bkShop.openStr" value="${(info.openStr)!''}" class="am-form-field"
                                       placeholder="开始时间" readonly>
                                <span class="am-input-group-label add-on" style="height: 1px;width: 1px;opacity: 0"><i
                                        class="icon-th am-icon-calendar"></i></span>
                            </div>
                            <div class="am-input-group date am-u-sm-6" id="closeTime">
                                <label for="endTime">结束时间</label>
                                <input size="16" type="text" id="endTime" name="bkShop.closeStr" value="${(info.closeStr)!''}" class="am-form-field"
                                       placeholder="结束时间" readonly>
                                <span class="am-input-group-label add-on" style="height: 1px;width: 1px;opacity: 0"><i
                                        class="icon-th am-icon-calendar"></i></span>
                            </div>
                        </div>
                    </div>

                    <div class="am-g am-margin-top-sm">
                        <div class="am-u-sm-4 am-u-md-2 am-text-right">
                            <button type="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <!-- content end -->

    </div>
</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
   data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

<footer>
    <hr>
    <p class="am-padding-left">${footer}</p>
</footer>

<!--[if lt IE 9]>

<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->

<!--<![endif]-->
<script src="/assets/js/jquery-2.1.0.js"></script>

<script src="/assets/js/amazeui.min.js"></script>
<script src="/assets/js/amazeui.js"></script>
<script src="/assets/datetimepicker/js/amazeui.datetimepicker.min.js"></script>
<script src="/cjwJs/utils.js"></script>
<script src="/assets/js/app.js"></script>
<script src="/cjwJs/uploadimage.js"></script>
<script src="/layer/layui.js"></script>
<script src="/layer/layer.js"></script>

<script>
    $('form').on('submit',function () {
        var name=$('input[name="bkShop.name"]').val();
        name=name.replace(/\ +/g,"");
        var openStr=$('input[name="bkShop.openStr"]').val();
        var closeStr=$('input[name="bkShop.closeStr"]').val();
        if(name.length==0||openStr.length==0||closeStr.length==0){
            layer.open({
                type: 1,
                id: 'layerDemo' + 1 ,
                title: '提示',
                content: '<div style="padding: 20px 50px;">请完善店铺资料</div>',
                btn: '确定',
                btnAlign: 'c' //按钮居中
                ,shade: 0 //不显示遮罩
                ,btn1: function () {
                    layer.closeAll();
                }
            })
            return false;
        }
    });
    $('#openTime').datetimepicker({format: 'hh:ii',startView:1});
    $('#closeTime').datetimepicker({format: 'hh:ii',startView:1});
    function selectImage() {
        layer.open({
            type: 2,
            area: ['700px', '530px'],
            fix: false, //不固定
            maxmin: true,
            skin: 'layui-layer-rim',
//            title: false,
//            closeBtn: 0,
            content: 'images'
        });

        return false;
    }
    $('#changePassword').on('click', function () {
        layer.open({
            type: 1,
            id: 'layerDemo' + 1 ,
            title: '修改密码',
            content: '<div style="padding: 10px 20px;"> <input type="password" name="oldPassworld" style="padding: 5px 10px" placeholder="输入原密码" pattern="^\d{6}$" required/></div><div style="padding: 10px 20px;"> <input type="password" name="password" style="padding: 5px 10px" placeholder="输入新密码" pattern="^\d{6}$" required/></div>',
            btn: '确定',
            btnAlign: 'c' //按钮居中
           ,shade: 0 //不显示遮罩
           ,btn1: function () {
                var url = '/bk/shop/changePassword/';
                var password = $('input[name="password"]').val();
                var oldPassworld = $('input[name="oldPassworld"]').val();
                layer.closeAll();
                var href=url+'?password='+password+'&oldPassworld='+oldPassworld;
                rquestStatus(href)
            }
        });
    });

</script>
</body>
</html>
